/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Bank.Client.Controller;

import Bank.Client.View.Balance;
import Bank.Model.Account;
import Bank.Model.AccountType;
import Bank.Model.User;
import java.util.ArrayList;

/**
 *
 * @author Appek
 */
public class BalanceViewController {
    
    private Balance view;
    
    public BalanceViewController(Balance view){
        this.view = view;
    }
    
    public boolean viewControllerReady()
    {
        return UserState.isLoggedIn();
    }
    
    public String getUserString()
    {
        String str = "Customer: " + UserState.getInstance().getUser().getFirstName();
        str = str + " " + UserState.getInstance().getUser().getLastName();
        return str;
    }
    
    public ArrayList getAccounts()
    {
        return UserState.getInstance().getAccounts();
    }
    
    public Double getBalance(int index)
    {
        Account acc = ((Account)UserState.getInstance().getAccounts().get(index));
        return acc.getBalance();
    }
}
